<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <link rel="stylesheet" href="./animate.min.css">
</head>

<body>
  <!-- 
       animate__animated:基础选择器，必须添加
       animate__swing：决定动画效果的选择器
  -->
  <P></P>
  <P></P>
  <h1 class="animate__animated animate__rotateInUpRight">An animated element</h1>
  <button>动</button>
  <script>
    let h1 = document.querySelector('h1')
    let btn = document.querySelector('button')
    btn.addEventListener('click', function () {
      h1.classList.add('animate__rotateInUpRight')
    })
  </script>
</body>

</html>